<link href="../addons/jy_baojfee/custom/templates/mobile/style.css?v=201705251730" rel="stylesheet">
<style>
.fui-header a.back:before {
    border-color: #fff;
}
</style>
<div class="fui-page fui-page-current page-commission-down">
	 <div class="fui-header sysbgcolor">
        <div class="fui-header-left">
            <a class="back" style="color:#fff" ng-click="goback();"></a>
        </div>
        <div class="title" style="color:#fff">{{pagedata.setting.tagent || '加盟商'}}({{pagedata.allagentnum}}个)</div>
    </div>
    <div class="fui-content">
        <div class="fui-tab fui-tab-danger" id="tab">
            <a ng-click="pagedata.params.type=1;pagedata.get_list()" ng-class="{'active':pagedata.params.type==1}" href="javascript:;">A组({{pagedata.anum}})</a>
			<a ng-click="pagedata.params.type=2;pagedata.get_list()" ng-class="{'active':pagedata.params.type==2}" href="javascript:;">B组({{pagedata.bnum}})</a>
			<a ng-click="pagedata.params.type=3;pagedata.get_list()" ng-class="{'active':pagedata.params.type==3}" href="javascript:;">接点人({{pagedata.jnum}})</a>
        </div>
		<div style="padding:0.5rem;margin-top:-0.5rem">
		<div class="gray c" style="padding-top:0.3rem;font-size:0.6rem">只显示直推，间推</div>
        <div  class="fui-list-group radius" id="container" >
		<div ng-repeat="item in pagedata.list" class="fui-list" style="height: auto">
			<div class="fui-list-media">
				<img ng-src="{{tomedia(item.member.avatar) ||'../core/resource/images/nopic.jpg'}}" class="round" style="width:2rem;height:2rem">
			</div>
			<div class="fui-list-inner">
				<div class="row">
				      <div class="row-text" >
					  <i ng-if="item.is_agent" class="icon icon-star text-danger"></i>
					 {{item.member.nickname}}<span class="gray">(MID: {{item.mid}})</span>
				      </div>
				</div>
				<div ng-if="item.isztui==1" class="subtitle">
					<span class="lable lable-success">我的直推</span>
					<span class="btn btn-sm btn-success" ng-click="post({},'/down/change/mid='+item.mid);">分到{{pagedata.params.type!=2?'B':'A'}}分组</span>
				</div>
				<div ng-if="item.isztui==1" class="subtitle">
					<span class="btn btn-sm btn-success" ng-click="pagedata.item=item;pagedata.showjie=true">修改接点人</span>
				</div>
				<div ng-if="item.is_agent ==1" class="subtitle">
				    成为{{pagedata.setting.tagent || '加盟商'}}时间: {{item.agenttime}}
				</div>
				<div ng-if="item.is_agent !=1" class="subtitle">
				    注册时间:{{item.createtime}}
				</div>
			</div>
			<div ng-if="item.is_agent" class="row-remark" style="min-width:3rem">
				<p>{{item.member_num}}个成员</p>
			</div>
			<div ng-if="!item.is_agent" class="row-remark" style="min-width:3rem">
				<p>消费: {{item.moneycount}}元</p>
				<p>{{item.ordercount}}个订单</p>
			</div>
		</div>
		</div>
		<div class='infinite-loading' style="display:none" id="loading_show"><span class='fui-preloader'></span><span class='text'> 正在加载...</span></div>
		<div ng-if="pagedata.list.length==0" class='content-empty' >
			<i class="icon jinyunicon icon-cry" style="width: 6rem;margin-bottom: 0.5rem;"></i>
			<br/>
			<p style="color: #999;font-size: .75rem">暂时没有任何数据</p>
		</div>
		</div>
    </div>
</div>
<div ng-if="pagedata.showjie" class="popup">
	<div class="popup-body">
		<div class="popup-bottom">
			<i class="closed icon icon-cuowu" ng-click="pagedata.showjie=false"></i>
			<div class='fui-cell-group'>
			<div class='fui-cell'>
				<div class='fui-cell-label' style="width:auto">接点人MID(邀请码)(只能设置一次)</div>
				<div class='fui-cell-info'><input type="text" class='fui-input' ng-model="pagedata.item.jie_id"  placeholder='填写接点人MID'/></div>
			</div>
			 <div class="weui_btn_area">
			 <a class="weui_btn weui_btn_primary" href="javascript:" id="showTooltips" ng-click="post(pagedata.item,'/down/changejie/')">提交</a>
			 </div>
			</div>
		</div>
	</div>
</div>
<div ng-include="sys_html('_footer')"></div>
<script>
scope.pagedata.get_list=function(){
	scope.tool.get_list('jy_baojfee/down/list/',true);
}
scope.tool.get_list('jy_baojfee/down/list/',true);
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('jy_baojfee/down/list/');
}
</script>

